# 🤖 Full Agent + Streamlit + LangChain - Copilot Installation Prompt

Use the following prompt with GitHub Copilot or any AI coding assistant to install and configure this project.

---

## 📋 Prompt for Copilot

```
I need help installing and running the "Full Agent + Streamlit + LangChain" project. This is a production-ready AI chatbot with RAG capabilities, moderation layers, and guardrails.

## Project Requirements

### System Dependencies
- **Python**: Version 3.11 or 3.12 (required)
- **Ollama**: Local LLM runtime (required)
- **Graphviz**: For visualization features (optional but recommended)

### Key Python Packages (from requirements.txt)
- streamlit==1.51.0
- langchain==1.1.2
- langchain-ollama==1.0.0
- langgraph==1.0.4
- faiss-cpu==1.13.0
- sentence-transformers==5.1.2
- torch>=2.0.0
- pdfplumber==0.11.8
- PyPDF2==3.0.1


## Installation Steps

### Step 1: Install System Dependencies

**Windows (PowerShell as Administrator):**
Run the script at: setup/windows/install.ps1
This will install:
- Microsoft Visual C++ Redistributable 2015+
- Ollama (via winget)
- Graphviz (via winget)

**macOS (Terminal):**
Run the script at: setup/mac/install.sh
This will install via Homebrew:
- Homebrew (if not installed)
- Graphviz
- Ollama

### Step 2: Create Python Virtual Environment

**Windows:**
python -m venv .venv
.\.venv\Scripts\activate

**macOS/Linux:**
python3 -m venv .venv
source .venv/bin/activate

### Step 3: Install Python Dependencies
pip install --upgrade pip
pip install -r requirements.txt

### Step 4: Configure Ollama
ollama serve
ollama pull qwen2.5  # or llama3.1

### Step 5: Generate FAISS Vector Database (if PDFs exist)
python src/rag/generate_vector_db.py

### Step 6: Run the Application
streamlit run ui.py


## Project Structure
Full Agent + streamlit + langchain/
├── ui.py                      # Main Streamlit entry point
├── setup/                     # Installation scripts
│   ├── windows/
│   │   ├── install.ps1        # Windows system setup
│   │   └── fix_pytorch_cuda.bat # GPU acceleration fix
│   └── mac/
│       └── install.sh         # macOS system setup
├── requirements.txt           # Python dependencies
├── config/
│   └── model_config.yaml      # LLM configuration
├── src/
│   ├── llm/                   # LLM clients and agent factory
│   ├── rag/                   # RAG with FAISS
│   ├── moderation/            # Security layer (PII, DLP, toxicity)
│   ├── guardrails/            # Quality validators
│   └── tools/                 # Agent tools
├── tabs/                      # Streamlit UI tabs
│   ├── chat_tab.py
│   ├── setup_tab.py
│   ├── rag_tab.py
│   ├── visualization_tab.py
│   ├── quality_validation_tab.py
│   └── help_tab.py
└── data/
    ├── docs/books/            # PDF documents for RAG
    └── embeddings/            # FAISS index (generated)


## Expected Output
After successful installation, the application should:
1. Open at http://localhost:8501
2. Show a chat interface with multiple tabs
3. Connect to Ollama for LLM inference
4. Support RAG search if documents are indexed


## Troubleshooting
- If Ollama connection fails: Ensure `ollama serve` is running
- If FAISS not found: Run `python src/rag/generate_vector_db.py`
- If torch fails: On Windows with NVIDIA GPU, run `setup\windows\fix_pytorch_cuda.bat`
```

---

## 🎯 Quick Commands Summary

| Task | Command |
|------|---------|
| System setup (Windows) | `.\setup\windows\install.ps1` |
| System setup (macOS) | `./setup/mac/install.sh` |
| Create venv (Windows) | `python -m venv .venv && .\.venv\Scripts\activate` |
| Create venv (macOS) | `python3 -m venv .venv && source .venv/bin/activate` |
| Install dependencies | `pip install -r requirements.txt` |
| Start Ollama | `ollama serve` |
| Pull model | `ollama pull qwen2.5` |
| Generate index | `python src/rag/generate_vector_db.py` |
| Run app | `streamlit run ui.py` |
